import request from "@/utils/request";

export function getChapter(params) {
    return request({
        url: '/user/plan/chapter/list',
        method: 'get',
        params
    })
}

// 根据章节获取视频
export function getVideo(params) {
    return request({
        url: '/user/plan/video',
        method: 'get',
        params
    })
}

export function getPubCourseList(params) {
    return request({
        url: '/user/plan/pubCourse/list',
        method: 'get',
        params
    })
}

export function updateProgress(data) {
    return request({
        url: '/user/plan/course/progress',
        method: 'post',
        data
    })
}

// 获取课程附件
export function getCourseAccessory(params) {
    return request({
        url: '/user/plan/course/res',
        method: 'get',
        params
    })
}

// 根据课程id获取课程的观看记录
export function getCourseHistoryById(courseId) {
    return request({
        url: '/user/plan/course/history/' + courseId,
        method: 'get',
    })
}
